package com.test.nnooolwdeaer.activity_fragment_wooden.base_wooden;

import android.text.TextUtils;

import androidx.fragment.app.Fragment;

import com.test.nnooolwdeaer.util_wooden.http_wooden.HttpManager_wooden;

public class BaseFragment_wooden extends Fragment {

    protected String pageTag_wooden;

    @Override
    public void onResume() {
        super.onResume();
        recordPageResumeEvent_wooden();
    }

    @Override
    public void onPause() {
        super.onPause();
        recordPagePauseEvent_wooden();
    }


    //页面埋点
    private void recordPagePauseEvent_wooden() {
        //保存埋点
        String fragmentName = getClass().getSimpleName();
        if (!TextUtils.isEmpty(pageTag_wooden)) fragmentName = pageTag_wooden;
        if (!TextUtils.isEmpty(fragmentName)) {
            HttpManager_wooden.getInstance_wooden().saveUserBuriedPoint((fragmentName + "_END").toUpperCase());
        }
    }

    //页面埋点
    private void recordPageResumeEvent_wooden() {
        //保存埋点
        String fragmentName = getClass().getSimpleName();
        if (!TextUtils.isEmpty(pageTag_wooden)) fragmentName = pageTag_wooden;
        if (!TextUtils.isEmpty(fragmentName)) {
            HttpManager_wooden.getInstance_wooden().saveUserBuriedPoint((fragmentName + "_START").toUpperCase());
        }
    }

}
